home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1996 January / macformat-033.iso / mac / Shareware City / Developers / ABox.v1.8 / CPlus Files / ABUEnvSpeechSynth.c < prev    next >
Encoding:
C/C++ Source or Header  |  1995-05-23  |  3.2 KB  |  120 lines  |  [TEXT/MMCC]

  1. /*    
  2.     Copyright © 1991-1995 by TopSoft Inc.  All rights reserved.
  3.  
  4.     You may distribute this file under the terms of the TopSoft
  5.     Artistic License, accompanying this package.
  6.     
  7.     This file was developed by George (ty) Tempel in connection with TopSoft, Inc..
  8.     See the Modification History for more details.
  9.  
  10. Product
  11.     About Box
  12.  
  13. FILE
  14.     ABUEnvSpeechSynth.c
  15.  
  16. NAME
  17.     ABUEnvSpeechSynth.c, part of the ABox project source code,
  18.     responsible for mix-in handling the AboutBox speech synthesis
  19.     environment stuff.
  20.  
  21. DESCRIPTION
  22.     This file contains defines for the about box modules.
  23.     
  24. DEVELOPED BY
  25.     George (ty) Tempel                netromancr@aol.com
  26.     All code in this file, and its associated header file was
  27.     Created by George (ty) Tempel in connection with the TopSoft, Inc.
  28.     "FilterTop" application development, except where noted.
  29.  
  30. CARETAKER - George (ty) Tempel <netromancr@aol.com>
  31.      Please consult this person for any changes or suggestions to this file.
  32.  
  33. MODIFICATION HISTORY
  34.  
  35.     dd mmm yy    -    xxx    -    patchxx: description of patch
  36.     10 June 94    -    ty    -    Initial Version Created
  37.     20-july-94    -    ty    -    initial version released
  38.     15-mar-95    -    ty    -    added some fixes since the speech mgr detection
  39.                             didn't seem to work on the PowerMac 8100/80 at work,
  40.                             yet works fine on all 680x0 macs. Go figger...
  41.     27-apr-95    -    ty    -    improved Gestalt checking
  42.     23-may-95    -    ty    -    changes for compatibility with the CodeWarrior CW6
  43.                             release and the associated Universal Headers from Apple:
  44.                             most methods that returned references now have "Ref" at
  45.                             the end of their methods names to prevent possible collisions
  46.                             with datatypes and classes of the same name (older versions
  47.                             of the compiler didn't have a problem with this).
  48.  
  49. */
  50.  
  51. /*===========================================================================*/
  52.  
  53. /*======= Segmentation directives ========*/
  54.  
  55. #ifdef USE_MANUAL_SEGMENTATION
  56. #pragma segment ty
  57. #endif
  58.  
  59. /*============ Header files ==============*/
  60.     
  61. #include     "ABUEnvSpeechSynth.h"
  62.  
  63. /*=============== Globals ================*/
  64.  
  65. /*================ CODE ==================*/
  66.  
  67.  
  68. /*=============================== ABUEnvSpeechSynth::ABUEnvSpeechSynth ================================*/
  69. ABUEnvSpeechSynth::ABUEnvSpeechSynth(void)
  70. {
  71. }    // end ABUEnvSpeechSynth
  72.  
  73.  
  74. /*=============================== ABUEnvSpeechSynth::~ABUEnvSpeechSynth ================================*/
  75. ABUEnvSpeechSynth::~ABUEnvSpeechSynth(void)
  76. {
  77. }    // end ~ABUEnvSpeechSynth
  78.  
  79.  
  80.  
  81. /*=============================== ABUEnvSpeechSynth::IsPresent ================================*/
  82. Boolean    ABUEnvSpeechSynth::IsPresent(void)
  83. {
  84.     OSErr    error = noErr;
  85.     
  86.     //    begin here...
  87.     
  88.     error = this->CheckGestalt(gestaltSpeechAttr);
  89. #if GENERATINGCFM
  90.     if ( (error == noErr) &&
  91.         (this->Attribute(gestaltSpeechMgrLibPresent) ||
  92.         this->Attribute(gestaltSpeechMgrPresent)) )
  93. #else
  94.     if ( (error == noErr) &&
  95.         (this->Attribute(gestaltSpeechMgrPresent)))
  96. #endif
  97.         this->IndicatorRef() = true;
  98.     else
  99.         this->IndicatorRef() = false;
  100.         
  101.     return this->IndicatorRef();
  102. }    // end IsPresent
  103.  
  104.  
  105.  
  106. /*=============================== ABUEnvSpeechSynth::End ================================*/
  107. OSErr    ABUEnvSpeechSynth::End(void)
  108. {
  109.     OSErr    error = noErr;
  110.     
  111.     //    begin here...
  112.     if (!this->IsPresent())
  113.         return error;
  114.     
  115.     error = ::SpeakString((StringPtr)NULL);
  116.  
  117.     return error;
  118. } // end End
  119.  
  120.